//
//  GradientsBootcamp.swift
//  FCSwiftUI
//
//  Created by 冯宣超 on 2023/2/19.
//

import SwiftUI

struct GradientsBootcamp: View {
    var body: some View {
        RoundedRectangle(cornerRadius: 25.0)
        //            .fill(Color.red)
            .fill(
//                LinearGradient(
//                    colors: [.red, .blue, .orange, .purple],
//                    startPoint: .topLeading,
//                    endPoint: .bottomTrailing
//                )
//                RadialGradient(
//                    colors: [.red, .blue],
//                    center: .topLeading,
//                    startRadius: 5,
//                    endRadius: 300
//                )
                AngularGradient(
                    colors: [.red, .blue],
                    center: .center,
                    angle: .degrees(45)
                )
            )
        
            .frame(width: 300, height: 200)
    }
}

struct GradientsBootcamp_Previews: PreviewProvider {
    static var previews: some View {
        GradientsBootcamp()
    }
}
